import Vue from 'vue'
import VueRouter from 'vue-router'
import Authentication from '../views/home/Authentication'
import Information from '../views/home/Information'

Vue.use(VueRouter)

const routes = [
	{
		path: '/Login',
		name: 'Login',
		// 应用懒加载，用到的时候才加载导入
		component: () => import('@/views/Login')
	},
	{
		path: '/',
		name: 'Home',
	
		component: () => import('@/views/Home'),
		// 子路由，path一般不以/开头
		children: [
			// 首页路由
			{
				path: 'index',
				name: 'Index',
				component: () => import('@/views/home/Index')
			},
			// 订单路由
			{
				path: 'order',
				name: 'Order',
				component: () => import('@/views/home/Order')
			},
			// 收益路由
			{
				path: 'money',
				name: 'Money',
				component: () => import('@/views/home/Money')
			},
			// 我的路由
			{
				path: 'mine',
				name: 'Mine',
				component: () => import('@/views/home/Mine')
			},
			// 实名认证路由
			{
				path: 'authentication',
				name: 'Authentication',
				component: Authentication
			},
			//   个人信息路由
			{
				path: 'information',
				name: 'Information',
				component: Information
			}
		]
	},
	// 订单详情路由
	{
		path: '/oreder_deatils',
		name: '',
		component: () => import('@/views/OrderDetail')
	},
]

const router = new VueRouter({
	mode: 'hash',
	// history是没有#
	// mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
